<?php

/** Define ABSPATH as this files directory */
define( 'ABSPATH', dirname(__FILE__) . '/' );

// begin the session
session_start();

//load config.php file
if ( file_exists( ABSPATH . 'config.php') ) {
	/** The config file resides in ABSPATH */
	require_once( ABSPATH . 'config.php' );
} else {
	die('No config.php file.');
}
//Check if use debug mode
if (DEBUG) {
	error_reporting(E_ALL);
	ini_set('display_errors', '1');
}

/**
* load ezSQL for database object
*
* Library url: http://justinvincent.com/ezsql
*
*/
require_once(ABSPATH .'libs/ez/shared/ez_sql_core.php'); //import ez_sql_core.php for sql library
require_once(ABSPATH .'libs/ez/ez_sql_mysql.php'); //import ez_sql_mysql.php for mysql library

$dbna = new ezSQL_mysql(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST); // create $db object of ezSQL_mysql and connect to database
$dbna->query('SET NAMES '. DB_CHARSET); //set database charset for support unicode(KHMER UNICODE))

/** 
* Pagination Class 
*
* Library url: http://www.catchmyfame.com/2011/10/23/php-pagination-class-updated-version-2/
*
*/

require_once(ABSPATH .'libs/paginator.class.php');
$paginate = new Paginator; //create paginator object

/**
* Class upload picture
*
* Library url: http://www.freelancer-id.com/upload-crop-resize-in-php
*/
require_once(ABSPATH .'libs/uploader.class.php');

/**
 * Load Project fuction
 * 
 */
include_once (ABSPATH.'includes/functions.php');
?>
